package com.example.taskdemo.hanlder;

import android.util.Log;

import com.example.taskdemo.DataSingle;
import com.example.taskdemo.bean.DistrubtuionData;
import com.example.taskdemo.bean.PlayData;

public class MSlamwareAgent {
    private static String TAG = "MSlamwareAgent";
    private static  MSlamwareAgent mSlamwareAgent;
    private void MSlamwareAgent(){}
    public static synchronized MSlamwareAgent getInstance(){
        if(mSlamwareAgent ==null){
            mSlamwareAgent = new MSlamwareAgent();
        }
        return mSlamwareAgent;
    }


    public void gotoPose(String text) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    try {
                        Log.d(TAG, "run: 正在前往！"+text);
                        for(int i= 0; i<10; i++){
                            sleeptest(100,"播放"+text);
                            DataSingle.getInstance().UPDistribuitonState(DistrubtuionData.DISTRIBUTIONSTATE.DISTRUBUTIONING);
                        }
                        Log.d(TAG, "run: 达到！"+text);
                        DataSingle.getInstance().UPDistribuitonState(DistrubtuionData.DISTRIBUTIONSTATE.FINISH);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }).start();
        }
    private void sleeptest(int millis,String info) throws InterruptedException {
        Thread.sleep(millis);
    }
}
